﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace Ele21RHelp
{
    /// <summary>
    /// 悄悄话.xaml 的交互逻辑
    /// </summary>
    public partial class 悄悄话 : Window
    {
        /// <summary>
        /// 选择的数字
        /// </summary>
        private string Number { get; set; }
        /// <summary>
        /// 选择的序号
        /// </summary>
        private string Index {  get; set; }
        public 悄悄话()
        {
            InitializeComponent();
        }
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            Button bt=sender as Button;
            Number = bt.DataContext.ToString();
            Copy();
        }
        private void Copy()
        {
            string copyStr = Index+"是 "+ Number;
            dstValue.Content = copyStr;
            HelpClass.CopyTo(copyStr);
        }

        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            Button bt = sender as Button;
            Index = bt.Content.ToString();
            Copy();
        }

        private void TextBox_TextChanged(object sender, TextChangedEventArgs e)
        {
            string dst = inpit1.Text;
            switch (dst)
            {
                case "1":dst = "一";break;
                case "2":dst = "二";break;
                case "3":dst = "三";break;
                case "4":dst = "四";break;
                case "5":dst = "五";break;
                case "6":dst = "六";break;
                default:
                    break;
            }

            Index = string.Format("第{0}位", dst); 
            Copy();
        }

        private void TextBox_TextChanged_1(object sender, TextChangedEventArgs e)
        {
            Number = input2.Text;
            Copy();
        }
    }
}
